Various classes of graphical models describe computations that can be performed on computational hardware, such as a computer, microcontroller, FPGA, and custom hardware. Classes of such graphical models include time-based block diagrams such as those found within Simulink® from The MathWorks, Inc. of Natick, Mass., state-based and flow diagrams, such as those found within Stateflow® from The MathWorks, Inc. of Natick, Mass., data-flow diagrams, circuit diagrams, and software diagrams, such as those found in the Unified Modeling Language. A common characteristic among these various forms of graphical models is that they define semantics on how to execute the diagram.
Historically, engineers and scientists have utilized graphical models in numerous scientific areas such as Feedback Control Theory and Signal Processing to study, design, debug, and refine dynamic systems. Dynamic systems, which are characterized by the fact that their behaviors change over time, or the fact that their states change or the fact that their behaviors change due to a system environment, are representative of many real-world systems. Graphical modeling has become particularly attractive over the last few years with the advent of software packages such as Simulink® from The MathWorks, Inc. of Natick, Mass. Such packages provide sophisticated software platforms with a rich suite of support tools that makes the analysis and design of dynamic systems efficient, methodical, and cost-effective.
A dynamic system, either natural or man-made, is a system whose response at any given time is a function of its input stimuli, its current state, the current time, and other input parameters. Such systems range from simple to highly complex systems. Physical dynamic systems include a falling body, the rotation of the earth, bio-mechanical systems (muscles, joints, etc.), bio-chemical systems (gene expression, protein pathways), weather and climate pattern systems, etc. Examples of man-made or engineered dynamic systems include: a bouncing ball, a spring with a mass tied on an end, automobiles, airplanes, control systems in major appliances, communication networks, audio signal processing, nuclear reactors, a stock market, etc.
Professionals from diverse areas such as engineering, science, education, and economics build graphical models of dynamic systems in order to better understand system behavior as it changes with the progression of time. The graphical models aid in building “better” systems, where “better” may be defined in terms of a variety of performance measures such as quality, time-to-market, cost, speed, size, power consumption, robustness, etc. The graphical models also aid in analyzing, debugging and repairing existing systems (be it the human body or the anti-lock braking system in a car). The models may also serve an educational purpose of educating others on the basic principles governing physical systems. The models and results are often used as a scientific communication medium between humans. The term “model-based design” is used to refer to the use of graphical models in the development, analysis, and validation of dynamic systems.
Graphical modeling environments such as Simulink®, assist in simplifying the process of designing, simulating, and implementing dynamic systems. A graphical model is a representation of a real-world system through a graph containing nodes (i.e. blocks) interconnected by arcs (i.e. lines). Blocks are functional entities that perform mathematical operations, transformations or both on the data and information being processed by the system. The lines, often referred to as signals in the art, represent streams of information, such as data, data types, timing information, and control information, flowing into, out of, and between various blocks. Signals in current graphical model environments have a number of attributes, such as data dimensions (i.e., signal dimensionality) and data type amongst other attributes. Signal data can be organized into a one-dimensional data structure for example, a vector or can be organized into a two-dimensional data structure, for example, a matrix, or can be organized into a three-dimensional or four-dimensional data structure.
As a model in a graphical modeling environment executes, signal dimensionality must be known so that signals can be properly processed within each block. If signal dimensionality is allowed to vary while the model executes, the time varying information regarding signal dimensions must somehow propagate along with the signal values. Using existing technology, the signal dimensions can propagate explicitly through additional lines in the model. The present invention is concerned with systems and methods that allow signal dimensionality to propagate implicitly.
For implicit propagation, there is no need for the user to provide explicit means in the model to handle the ongoing propagation of signal dimensions. Each block is able to query somehow for its signal dimensions at each time instant. In this case of implicit signal dimension propagation, each signal with variable dimensions has a mechanism by which each block connected to that signal has a way to get and/or set that signal's dimensionality at each time instant. For example, each block reading a variable sized signal on an input port needs a way to get that signal's dimensionality. Similarly, blocks that write to a dynamic sized signal on their output need a set method for the signal's dimensions. This “dimensionality attribute” does not require a line of its own and need not appear as a signal in any way in the model. This is not to say that it would be impossible for the user to have some kind of visible affordance related to a dynamically sized signal; it is just not a requirement that this dimensionality information be explicit in the model.
Moreover, the time varying nature of a signal's variable data dimensionality implies that memory requirements for input and output buffers associated with blocks that operate on such signals might increase, decrease, or both, as the model executes. To accommodate a signal's variable data dimensionality it is often the case that a worst case memory allocation occurs before the model begins execution so that memory sufficient for each signal's maximum data size is pre-allocated. Alternatively, an engine and code generated from the model can provide for run-time dynamic memory allocation to accommodate the memory requirements of a signal as its size varies during execution of the model. As an example of dynamic memory allocation, container objects from a C++ Standard Template library can be used as signals in a graphical modeling environment. These objects have dynamic memory allocation built into them.
In graphical models with dynamically sized signals using a worst case memory allocation scheme, the actual size of the signal buffers remains fixed and the entire structure is filed with relevant data and irrelevant data. The relevant data being the data on which a block is to carry out an operation on. The remainder of the data is ignored by blocks that use that buffer.
Graphical modeling environments, such as the technical computing environment of MATLAB® from the MathWorks, Inc. of Natick, Mass., can provide a “model-based design” approach to designing an implementation. The term “model-based design” is used to refer to a graphical model acting as a design. A model-based design may be used as a design specification for an implementation, such as an implementation of an algorithm in hardware circuitry or the implementation of code to run on a computer. A graphical block diagram modeling environment can produce designs in graphical block diagram form to specify computations that can be performed on computational hardware such as a general purpose processor, microcontroller, DSP, FPGA, PLD, or ASIC. That is, a model-based design is well suited for use as a design specification, for the model-based design can drive the building process of an implementation of the design. For instance, the model-based design can act as a specification from which to automatically generate code from a graphical model in a graphical modeling environment.
Although a graphical modeling environment, such as Simulink® from the MathWorks, Inc. of Natick, Mass., provides graphical block diagram models for the design and code of the computations to execute on computational hardware, the graphical block diagram model design does not provide for the design of the implementation of a model having one or more signals with dynamic dimensioning without using graphical connections in the model to convey the dimension information. The many applications that can benefit from dynamically sized signals are more conveniently modeled if the dynamic sizes did not have to be explicitly handled by the person building the model.